package com.home.cop.enums;

public enum YesOrNoEnum {
    YES("是",1),NO("否",0);

    private Integer code;
    private String name;

    private YesOrNoEnum(String name,Integer code){
        this.code = code;
        this.name = name;
    }
    public static boolean contains(int code) {
        for (YesOrNoEnum flagEnum : YesOrNoEnum.values()) {
            if (flagEnum.getCode() == code) {
                return true;
            }
        }
        return false;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
